<?php

class currency{
	
	// Define variables
	private $ID_CURRENCY;
	private $CURRENCY_NAME;
	private $SIMBOL;
	private $VALUE;
	
	// Connection with database and instance creation
	private $DB;
	public function __construct() {
		$config = config::getInstance();
		$this->DB = $config->config_values['database']['db_prefix'];
	}
	
	// Getters and setters functions
  	public function setID_CURRENCY($value) {
  		$this->ID_CURRENCY = $value;
  	}
	public function getID_CURRENCY() {
  		return $this->ID_CURRENCY;
  	}
	public function setCURRENCY_NAME($value) {
  		$this->CURRENCY_NAME = $value;
  	}
	public function getCURRENCY_NAME() {
  		return $this->CURRENCY_NAME;
  	}
	public function setSIMBOL($value) {
  		$this->SIMBOL = $value;
  	}
	public function getSIMBOL() {
  		return $this->SIMBOL;
  	}
	public function setVALUE($value) {
  		$this->VALUE = $value;
  	}
	public function getVALUE() {
  		return $this->VALUE;
  	}

	// General functions:
  	public function load($id)
	{
		$db = db::getInstance();
		$sql = "SELECT * FROM ".$this->DB."currency WHERE ID_CURRENCY=".$id;

		foreach ($db->query($sql) as $row) {
			$this->setID_CURRENCY($row['ID_CURRENCY']);
			$this->setCURRENCY_NAME($row['CURRENCY_NAME']);
			$this->setSIMBOL($row['SIMBOL']);
			$this->setVALUE($row['VALUE']);
		}
	    $db = null; 
	    return true;			
  	}

  	public function insert(){}

  	public function modify($id){}

  	public function delete($id){}
  	
}
?>